<!doctype html>
<html lang="en">
    <head>
        <!-- Required meta tags -->
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
        <!-- head 中 -->
        <link rel="stylesheet" href="css/materialize.min.css">

        <link href="http://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">

        <title>H5 网页示例</title>
    </head>
    <body style="margin-left: 10px;margin-right: 10px">

        <div class="card-panel" style="padding: 14px">
            <label style="font-weight: bold;color: #ff8f87;font-size: 14px">启动之前，记得设置好参数，保存参数！！！</label>
        </div>

        <form id="formData">

            <!-- 基本模式信息设置 -->
            <div class="card-panel">
                <span class="card-title">基本模式信息设置</span>
                <div class="row s12 ">

                    <div class="input-field inline col s6">
                        <label>
                            <input type="checkbox" name="base_attention_mode" id="base_attention_mode"
                                   class="filled-in"/>
                            <span>😀关注</span>
                        </label>
                    </div>
                    <div class="input-field inline col s6">
                        <label>
                            <input type="checkbox" name="base_like_mode" id="base_like_mode" class="filled-in"
                            />
                            <span>😍点赞</span>
                        </label>
                    </div>
                    <div class="input-field inline col s6">
                        <label>
                            <input type="checkbox" name="base_collect_mode" id="base_collect_mode"
                                   class="filled-in"/>
                            <span>😃收藏</span>
                        </label>
                    </div>
                    <div class="input-field inline col s6">
                        <label>
                            <input type="checkbox" name="base_remark_mode" id="base_remark_mode"
                                   class="filled-in"/>
                            <span>🤑评论</span>
                        </label>
                    </div>

                    <div class="input-field inline col s6">
                        <label>
                            <input type="checkbox" name="base_addAlbum_mode" id="base_addAlbum_mode"
                                   class="filled-in"/>
                            <span>😊加入专辑</span>
                        </label>
                    </div>

                    <div class="input-field inline col s6">
                        <label>
                            <input type="checkbox" name="base_url_mode" id="base_url_mode"
                                   onchange="javascript:saveURLMode()"
                                   class="filled-in"/>
                            <span>😰网址模式</span>
                        </label>
                    </div>

<!--                    <div class="input-field inline col s6">-->
<!--                        <label>-->
<!--                            <input type="checkbox" name="base_pink_car_mode" id="base_pink_car_mode"-->
<!--                                   class="filled-in"/>-->
<!--                            <span>😆粉车</span>-->
<!--                        </label>-->
<!--                    </div>-->

                    <div class="input-field inline col s6">
                        <label>
                            <input type="checkbox" name="base_collection_before_mode" id="base_collection_before_mode"
                                   class="filled-in"/>
                            <span>🤤先藏后赞</span>
                        </label>
                    </div>

                </div>
            </div>
            <!-- 基本模式信息设置 -->

            <!-- 当前作业车设置 -->
            <div class="card-panel">
                <span class="card-title">当前作业车设置</span>
                <!-- 作业车顺序 start -->
                <div class="row s12 ">
                    <div class="input-field inline col s6">
                        <label>
                            <input name="base_run_order_mode_up" class="with-gap" type="radio" checked
                                   id="run_order_mode_up" onclick="javascript:radioCheckUP()"/>
                            <span>从上到下作业</span>
                        </label>
                    </div>

                    <div class="input-field inline col s6">
                        <label>
                            <input name="base_run_order_mode_down" class="with-gap" type="radio"
                                   id="run_order_mode_down" onclick="javascript:radioCheckDOWN()"/>
                            <span>从下到上作业</span>
                        </label>
                    </div>
                </div>
                <!-- 作业车顺序 end -->

                <!-- 人数设置 start -->
                <div class="videoStyle row s12 " style="padding-top: 15px">
                    <div class="detailStyle input-field col s4">
                        <p>作业车人数:</p>
                    </div>
                    <div class="detailStyle input-field inline col s8">
                        <label for="detail_carTotalNum">默认9999人，需要的人使用即可</label>
                        <input id="detail_carTotalNum" type="text" class="validate" name="detail_carTotalNum"
                               style="text-align: center">
                    </div>
                </div>
                <!-- 人数设置 end -->

                <!-- 下一个博主间隔时间 start -->
                <div class="videoStyle row s12 " style="padding-top: 15px">
                    <div class="detailStyle input-field col s6">
                        <p>下一个博主间隔时间:</p>
                    </div>
                    <div class="detailStyle input-field inline col s5">
                        <label for="detail_before_next_time">默认0秒</label>
                        <input id="detail_before_next_time" type="text" class="validate" name="detail_before_next_time"
                               style="text-align: center">
                    </div>
                    <div class="detailStyle input-field col s1">
                        <p>秒</p>
                    </div>
                </div>
                <!-- 下一个博主间隔时间 end -->

            </div>
            <!-- 当前作业车设置 -->


            <!-- 图文详情设置 -->
            <div class="card-panel">
                <span class="card-title">图文详情设置</span>

                <div class="videoStyle row s12 ">

                    <!-- 专辑名称 start -->
                    <div class="detailStyle input-field col s3">
                        <p>专辑名称:</p>
                    </div>
                    <div class="detailStyle input-field inline col s9">
                        <label for="detail_albumName">填错或不填写，默认选择第一个</label>
                        <input id="detail_albumName" type="text" class="validate" name="detail_albumName"
                               style="text-align: center">
                    </div>
                    <!-- 专辑名称 end -->

                    <!-- 赞藏执行次数 start -->
                    <div class="detailStyle input-field col s4">
                        <p>赞藏执行次数:</p>
                    </div>
                    <div class="detailStyle input-field inline col s7">
                        <label for="detail_likeAndCollectRunTime">默认执行1次，最大执行5次</label>
                        <input id="detail_likeAndCollectRunTime" type="text" class="validate"
                               name="detail_likeAndCollectRunTime"
                               style="text-align: center">
                    </div>
                    <div class="detailStyle input-field col s1">
                        <p>次</p>
                    </div>
                    <!-- 赞藏执行次数 end -->


                    <!-- 普通点赞数范围 start -->
                    <div class="detailStyle input-field col s5">
                        <p>普通点赞数范围:</p>
                    </div>
                    <div class="detailStyle input-field inline col s2">
                        <label for="detail_likeMin">默认5</label>
                        <input id="detail_likeMin" type="text" class="validate" name="detail_likeMin"
                               style="text-align: center">
                    </div>
                    <div class="detailStyle input-field col s1">
                        <p>-</p>
                    </div>
                    <div class="detailStyle input-field inline col s4">
                        <label for="detail_likeMax">默认9999</label>
                        <input id="detail_likeMax" type="text" class="validate" name="detail_likeMax"
                               style="text-align: center">
                    </div>
                    <!-- 普通点赞数范围 end -->


                    <!-- 置顶点赞数范围 start -->
                    <div class="detailStyle input-field col s5">
                        <p>置顶点赞数范围:</p>
                    </div>
                    <div class="detailStyle input-field inline col s2">
                        <label for="detail_topLikeMin">默认0</label>
                        <input id="detail_topLikeMin" type="text" class="validate" name="detail_topLikeMin"
                               style="text-align: center">
                    </div>
                    <div class="detailStyle input-field col s1">
                        <p>-</p>
                    </div>
                    <div class="detailStyle input-field inline col s4">
                        <label for="detail_topLikeMax">默认600</label>
                        <input id="detail_topLikeMax" type="text" class="validate" name="detail_topLikeMax"
                               style="text-align: center">
                    </div>
                    <!-- 置顶点赞数范围 end -->


                    <!-- 关注-点赞间隔时间 start -->
                    <div class="detailStyle input-field col s6">
                        <p>关注-点赞间隔时间:</p>
                    </div>
                    <div class="detailStyle input-field inline col s2">
                        <label for="detail_focusAndLikeTime1">默认2</label>
                        <input id="detail_focusAndLikeTime1" type="text" class="validate"
                               name="detail_focusAndLikeTime1"
                               style="text-align: center">
                    </div>
                    <div class="detailStyle input-field col s1">
                        <p>-</p>
                    </div>
                    <div class="detailStyle input-field inline col s2">
                        <label for="detail_focusAndLikeTime2">默认5</label>
                        <input id="detail_focusAndLikeTime2" type="text" class="validate"
                               name="detail_focusAndLikeTime2"
                               style="text-align: center">
                    </div>

                    <div class="detailStyle input-field col s1">
                        <p>秒</p>
                    </div>
                    <!-- 关注-点赞间隔时间 end -->


                    <!-- 点赞-收藏间隔时间 start -->
                    <div class="detailStyle input-field col s6">
                        <p>点赞-收藏间隔时间:</p>
                    </div>
                    <div class="detailStyle input-field inline col s2">
                        <label for="detail_likeAndCollectTime1">默认10</label>
                        <input id="detail_likeAndCollectTime1" type="text" class="validate"
                               name="detail_likeAndCollectTime1"
                               style="text-align: center">
                    </div>

                    <div class="detailStyle input-field col s1">
                        <p>-</p>
                    </div>

                    <div class="detailStyle input-field inline col s2">
                        <label for="detail_likeAndCollectTime2">默认16</label>
                        <input id="detail_likeAndCollectTime2" type="text" class="validate"
                               name="detail_likeAndCollectTime2"
                               style="text-align: center">
                    </div>
                    <div class="detailStyle input-field col s1">
                        <p>秒</p>
                    </div>
                    <!-- 点赞-收藏间隔时间 end -->

                    <!-- 向左滑动次数 start -->
                    <div class="detailStyle input-field col s5">
                        <p>向左滑动次数:</p>
                    </div>
                    <div class="detailStyle input-field inline col s2">
                        <label for="detail_product_detail_leftTimes1">默认3</label>
                        <input id="detail_product_detail_leftTimes1" type="text" class="validate"
                               name="detail_product_detail_leftTimes1"
                               style="text-align: center">
                    </div>
                    <div class="detailStyle input-field col s1">
                        <p>-</p>
                    </div>
                    <div class="detailStyle input-field inline col s3">
                        <label for="detail_product_detail_leftTimes2">默认4</label>
                        <input id="detail_product_detail_leftTimes2" type="text" class="validate"
                               name="detail_product_detail_leftTimes2"
                               style="text-align: center">
                    </div>
                    <div class="detailStyle input-field col s1">
                        <p>次</p>
                    </div>
                    <!-- 向左滑动次数 end -->

                    <!-- 向右滑动次数 start -->
                    <div class="detailStyle input-field col s5">
                        <p>向右滑动次数:</p>
                    </div>
                    <div class="detailStyle input-field inline col s2">
                        <label for="detail_product_detail_rightTimes1">默认1</label>
                        <input id="detail_product_detail_rightTimes1" type="text" class="validate"
                               name="detail_product_detail_rightTimes1"
                               style="text-align: center">
                    </div>
                    <div class="detailStyle input-field col s1">
                        <p>-</p>
                    </div>
                    <div class="detailStyle input-field inline col s3">
                        <label for="detail_product_detail_rightTimes2">默认2</label>
                        <input id="detail_product_detail_rightTimes2" type="text" class="validate"
                               name="detail_product_detail_rightTimes2"
                               style="text-align: center">
                    </div>
                    <div class="detailStyle input-field col s1">
                        <p>次</p>
                    </div>
                    <!-- 向右滑动次数 end -->

                    <!-- 向下滑动次数 start -->
                    <div class="detailStyle input-field col s5">
                        <p>向下滑动次数:</p>
                    </div>
                    <div class="detailStyle input-field inline col s2">
                        <label for="detail_product_detail_bottomTimes1">默认2</label>
                        <input id="detail_product_detail_bottomTimes1" type="text" class="validate"
                               name="detail_product_detail_bottomTimes1"
                               style="text-align: center">
                    </div>
                    <div class="detailStyle input-field col s1">
                        <p>-</p>
                    </div>
                    <div class="detailStyle input-field inline col s3">
                        <label for="detail_product_detail_bottomTimes2">默认3</label>
                        <input id="detail_product_detail_bottomTimes2" type="text" class="validate"
                               name="detail_product_detail_bottomTimes2"
                               style="text-align: center">
                    </div>
                    <div class="detailStyle input-field col s1">
                        <p>次</p>
                    </div>
                    <!-- 向下滑动次数 end -->

                    <!-- 向上滑动次数 start -->
                    <div class="detailStyle input-field col s5">
                        <p>向上滑动次数:</p>
                    </div>
                    <div class="detailStyle input-field inline col s2">
                        <label for="detail_product_detail_topTimes1">默认3</label>
                        <input id="detail_product_detail_topTimes1" type="text" class="validate"
                               name="detail_product_detail_topTimes1"
                               style="text-align: center">
                    </div>
                    <div class="detailStyle input-field col s1">
                        <p>-</p>
                    </div>
                    <div class="detailStyle input-field inline col s3">
                        <label for="detail_product_detail_topTimes2">默认4</label>
                        <input id="detail_product_detail_topTimes2" type="text" class="validate"
                               name="detail_product_detail_topTimes2"
                               style="text-align: center">
                    </div>
                    <div class="detailStyle input-field col s1">
                        <p>次</p>
                    </div>
                    <!-- 向上滑动次数 end -->

                </div>
            </div>
            <!-- 图文详情设置 -->


            <!-- 视频详情设置 -->
            <div class="card-panel">
                <span class="card-title">视频详情设置</span>

                <div class="videoStyle row s12">
                    <div class="input-field col s5">
                        <p>视频浏览时间:</p>
                    </div>
                    <div class="input-field inline col s2">
                        <label for="videoTakeTime1">默认20</label>
                        <input id="videoTakeTime1" type="text" class="validate" name="videoTakeTime1"
                               style="text-align: center">
                    </div>
                    <div class="detailStyle input-field col s1">
                        <p>-</p>
                    </div>
                    <div class="input-field inline col s3">
                        <label for="videoTakeTime2">默认28</label>
                        <input id="videoTakeTime2" type="text" class="validate" name="videoTakeTime2"
                               style="text-align: center">
                    </div>
                    <div class="input-field inline col s1">
                        <p>秒</p>
                    </div>
                </div>
            </div>
            <!-- 视频详情设置 -->

        </form>
        <div class="row 12">
            <div class="col s6">
                <button class="btn waves-effect waves-light " type="button" name="action"
                        style="background-color: #FF9C97"
                        onclick="javascript:save(0)">保存参数
                </button>
            </div>
        </div>

        <script src="htmljs/jquery.min.js"></script>
        <script src="htmljs/materialize.min.js"></script>
    </body>

    <style>
        .videoStyle {
            margin-bottom: -12px;
        }

        .detailStyle {
            margin-bottom: 0px;
            margin-top: 0px;
        }

        .card-panel {
            padding: 6px;
        }

        .card-title {
            font-weight: bold;
        }
    </style>

    <script>

        function radioCheckUP() {
            if ($("#run_order_mode_up").prop("checked")) {
                $("#run_order_mode_down").attr("checked", false);
            } else {
                $("#run_order_mode_up").attr("checked", true);
                $("#run_order_mode_down").attr("checked", false);
            }
        }

        function radioCheckDOWN() {
            if ($("#run_order_mode_down").prop("checked")) {
                $("#run_order_mode_up").attr("checked", false);
            } else {
                $("#run_order_mode_down").attr("checked", true);
                $("#run_order_mode_up").attr("checked", false);
            }
        }

        function loadData(obj) {
            var key, value, tagName, type;
            for (x in obj) {
                key = x;
                value = obj[x];
                $("[name='" + value.name + "']").each(function () {
                    tagName = $(this)[0].tagName;
                    type = $(this).attr('type');
                    if (tagName === 'INPUT') {
                        if (type === 'radio') {
                            $(this).attr('checked', $(this).val() === value.value);
                            if (value.name === "base_run_order_mode_down") {
                                radioCheckDOWN();
                            }
                        } else if (type === 'checkbox') {
                            if ($(this).val() === value.value) {
                                $(this).attr('checked', true);
                            } else {
                                $(this).attr('checked', false);
                            }
                        } else {
                            $(this).val(value.value);
                        }

                    } else if (tagName === 'SELECT' || tagName === 'TEXTAREA') {
                        $(this).val(value);
                    }
                });
            }
        }

        Date.prototype.format = function (fmt) {
            var o = {
                "M+": this.getMonth() + 1,                 //月份
                "d+": this.getDate(),                    //日
                "h+": this.getHours(),                   //小时
                "m+": this.getMinutes(),                 //分
                "s+": this.getSeconds(),                 //秒
                "q+": Math.floor((this.getMonth() + 3) / 3), //季度
                "S": this.getMilliseconds()             //毫秒
            };
            if (/(y+)/.test(fmt)) {
                fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
            }
            for (var k in o) {
                if (new RegExp("(" + k + ")").test(fmt)) {
                    fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
                }
            }
            return fmt;
        };

        $(function () {
            var data = window.ec.call('collection_like_read', JSON.stringify({
                'action': 'android.settings.SETTINGS'
            }));
            if (data !== undefined || data !== null) {
                loadData(JSON.parse(data))
            }
            $.each($("input"), function (i, field) {
                if ($(this).val() !== "") {
                    $(this).prev().attr("class", "active");
                }
            });
            $("#detail_carTotalNum").val("");

            save(1);
        });

        function saveURLMode() {
            if (eval($("#base_url_mode").prop("checked"))) {
                window.ec.toast("记得前往网址页面添加链接~");
            }
        }


        //保存参数的函数
        function save(num) {

            var carTotalNum = $("#detail_carTotalNum").val();
            if (carTotalNum === "" || carTotalNum === undefined) {
                window.ec.saveConfig("carTotalNum_", 9999);
            } else {
                if (/(^[1-9]\d*$)/.test(carTotalNum)) {
                    window.ec.saveConfig("carTotalNum_", carTotalNum);
                } else {
                    window.ec.toast("作业车人数必须为数字！！！");
                    return;
                }
            }

            // 基本设置信息
            window.ec.saveConfig("base_attention_mode_", $("#base_attention_mode").prop("checked"));
            window.ec.saveConfig("base_like_mode_", $("#base_like_mode").prop("checked"));
            window.ec.saveConfig("base_collect_mode_", $("#base_collect_mode").prop("checked"));
            window.ec.saveConfig("base_remark_mode_", $("#base_remark_mode").prop("checked"));
            window.ec.saveConfig("base_addAlbum_mode_", $("#base_addAlbum_mode").prop("checked"));
            window.ec.saveConfig("base_collection_before_mode_", $("#base_collection_before_mode").prop("checked"));
            window.ec.saveConfig("run_order_mode_up_", $("#run_order_mode_up").prop("checked"));
            // window.ec.saveConfig("base_safe_mode_", $("#base_safe_mode").prop("checked"));

            // 专辑名称
            var albumName = $("#detail_albumName").val();
            window.ec.saveConfig("albumName", albumName);

            // 赞藏执行次数，小于5
            var detail_likeAndCollectRunTime_txt = $("#detail_likeAndCollectRunTime").val();
            if (detail_likeAndCollectRunTime_txt !== "") {
                if (/(^[1-9]\d*$)/.test(detail_likeAndCollectRunTime_txt) &&
                    detail_likeAndCollectRunTime_txt < 6) {
                    window.ec.saveConfig("detail_likeAndCollectRunTime", detail_likeAndCollectRunTime_txt);
                } else {
                    window.ec.toast("赞藏执行次数为正整数，（1-5）次！");
                    return
                }
            } else {
                window.ec.saveConfig("detail_likeAndCollectRunTime", 1);
            }

            var attentionAndLikeWaitTime1 = $("#detail_focusAndLikeTime1").val();
            if (attentionAndLikeWaitTime1 !== "") {
                if (/(^[1-9]\d*$)/.test(attentionAndLikeWaitTime1)) {
                    window.ec.saveConfig("attentionAndLikeWaitTime1", attentionAndLikeWaitTime1);
                } else {
                    window.ec.toast("关注-点赞间隔时长为正整数，默认为2s");
                    return;
                }
            } else {
                window.ec.saveConfig("attentionAndLikeWaitTime1", 2);
            }

            var attentionAndLikeWaitTime2 = $("#detail_focusAndLikeTime2").val();
            if (attentionAndLikeWaitTime2 !== "") {
                if (/(^[1-9]\d*$)/.test(attentionAndLikeWaitTime2)) {
                    window.ec.saveConfig("attentionAndLikeWaitTime2", attentionAndLikeWaitTime2);
                } else {
                    window.ec.toast("关注-点赞间隔时长为正整数，默认为5s");
                    return;
                }
            } else {
                window.ec.saveConfig("attentionAndLikeWaitTime2", 5);
            }

            var likeAndCollectWaitTime1 = $("#detail_likeAndCollectTime1").val();
            if (likeAndCollectWaitTime1 !== "") {
                if (/(^[1-9]\d*$)/.test(likeAndCollectWaitTime1)) {
                    window.ec.saveConfig("likeAndCollectWaitTime1", likeAndCollectWaitTime1);
                } else {
                    window.ec.toast("点赞-收藏间隔时长为正整数，默认为10s");
                    return;
                }
            } else {
                window.ec.saveConfig("likeAndCollectWaitTime1", 10);
            }

            var likeAndCollectWaitTime2 = $("#detail_likeAndCollectTime2").val();
            if (likeAndCollectWaitTime2 !== "") {
                if (/(^[1-9]\d*$)/.test(likeAndCollectWaitTime2)) {
                    window.ec.saveConfig("likeAndCollectWaitTime2", likeAndCollectWaitTime2);
                } else {
                    window.ec.toast("点赞-收藏间隔时长为正整数，默认为16s");
                    return;
                }
            } else {
                window.ec.saveConfig("likeAndCollectWaitTime2", 16);
            }

            var videoTakeTime_1 = $("#videoTakeTime1").val();
            if (videoTakeTime_1 !== "") {
                if (/(^[1-9]\d*$)/.test(videoTakeTime_1)) {
                    window.ec.saveConfig("videoTakeTime_txt1", videoTakeTime_1);
                } else {
                    window.ec.toast("视频浏览时间为正整数，默认为20s");
                    return;
                }
            } else {
                window.ec.saveConfig("videoTakeTime_txt1", 20);
            }

            var videoTakeTime_2 = $("#videoTakeTime2").val();
            if (videoTakeTime_2 !== "") {
                if (/(^[1-9]\d*$)/.test(videoTakeTime_2)) {
                    window.ec.saveConfig("videoTakeTime_txt2", videoTakeTime_2);
                } else {
                    window.ec.toast("视频浏览时间为正整数，默认为28s");
                    return;
                }
            } else {
                window.ec.saveConfig("videoTakeTime_txt2", 28);
            }

            var detail_topLikeMin_ = $("#detail_topLikeMin").val();
            if (detail_topLikeMin_ !== "") {
                if (/(^[0-9]\d*$)/.test(detail_topLikeMin_)) {
                    window.ec.saveConfig("detail_topLikeMin_txt", detail_topLikeMin_);
                } else {
                    window.ec.toast("最小置顶点赞数设置错误，默认为0");
                    return;
                }
            } else {
                window.ec.saveConfig("detail_topLikeMin_txt", 0);
            }
            var detail_topLikeMax_ = $("#detail_topLikeMax").val();
            if (detail_topLikeMax_ !== "") {
                if (/(^[0-9]\d*$)/.test(detail_topLikeMax_)) {
                    window.ec.saveConfig("detail_topLikeMax_txt", detail_topLikeMax_);
                } else {
                    window.ec.toast("最大置顶点赞数设置错误，默认为600");
                    return;
                }
            } else {
                window.ec.saveConfig("detail_topLikeMax_txt", 600);
            }

            var detail_LikeMin_ = $("#detail_likeMin").val();
            if (detail_LikeMin_ !== "") {
                if (/(^[0-9]\d*$)/.test(detail_LikeMin_)) {
                    window.ec.saveConfig("detail_likeMin_txt", detail_LikeMin_);
                } else {
                    window.ec.toast("最小普通点赞数设置错误，默认为5");
                    return;
                }
            } else {
                window.ec.saveConfig("detail_likeMin_txt", 5);
            }
            var detail_LikeMax_ = $("#detail_likeMax").val();
            if (detail_LikeMax_ !== "") {
                if (/(^[0-9]\d*$)/.test(detail_LikeMax_)) {
                    window.ec.saveConfig("detail_likeMax_txt", detail_LikeMax_);
                } else {
                    window.ec.toast("最大普通点赞数设置错误，默认为9999");
                    return;
                }
            } else {
                window.ec.saveConfig("detail_likeMax_txt", 9999);
            }

            var detail_before_next_time_ = $("#detail_before_next_time").val();
            if (detail_before_next_time_ !== "") {
                window.ec.saveConfig("detail_before_next_time_txt", detail_before_next_time_);
            } else {
                window.ec.saveConfig("detail_before_next_time_txt", 0);
            }

            var leftTimes_1 = $("#detail_product_detail_leftTimes1").val();
            if (leftTimes_1 !== "") {
                window.ec.saveConfig("detail_product_detail_leftTimes_txt1", leftTimes_1);
            } else {
                window.ec.saveConfig("detail_product_detail_leftTimes_txt1", 3);
            }
            var leftTimes_2 = $("#detail_product_detail_leftTimes2").val();
            if (leftTimes_2 !== "") {
                window.ec.saveConfig("detail_product_detail_leftTimes_txt2", leftTimes_2);
            } else {
                window.ec.saveConfig("detail_product_detail_leftTimes_txt2", 4);
            }

            var rightTimes_1 = $("#detail_product_detail_rightTimes1").val();
            if (rightTimes_1 !== "") {
                window.ec.saveConfig("detail_product_detail_rightTimes_txt1", rightTimes_1);
            } else {
                window.ec.saveConfig("detail_product_detail_rightTimes_txt1", 1);
            }
            var rightTimes_2 = $("#detail_product_detail_rightTimes2").val();
            if (rightTimes_2 !== "") {
                window.ec.saveConfig("detail_product_detail_rightTimes_txt2", rightTimes_2);
            } else {
                window.ec.saveConfig("detail_product_detail_rightTimes_txt2", 2);
            }

            var bottomTimes_1 = $("#detail_product_detail_bottomTimes1").val();
            if (bottomTimes_1 !== "") {
                window.ec.saveConfig("detail_product_detail_bottomTimes_txt1", bottomTimes_1);
            } else {
                window.ec.saveConfig("detail_product_detail_bottomTimes_txt1", 2);
            }
            var bottomTimes_2 = $("#detail_product_detail_bottomTimes2").val();
            if (bottomTimes_2 !== "") {
                window.ec.saveConfig("detail_product_detail_bottomTimes_txt2", bottomTimes_2);
            } else {
                window.ec.saveConfig("detail_product_detail_bottomTimes_txt2", 3);
            }

            var topTimes_1 = $("#detail_product_detail_topTimes1").val();
            if (topTimes_1 !== "") {
                window.ec.saveConfig("detail_product_detail_topTimes_txt1", topTimes_1);
            } else {
                window.ec.saveConfig("detail_product_detail_topTimes_txt1", 3);
            }
            var topTimes_2 = $("#detail_product_detail_topTimes2").val();
            if (topTimes_2 !== "") {
                window.ec.saveConfig("detail_product_detail_topTimes_txt2", topTimes_2);
            } else {
                window.ec.saveConfig("detail_product_detail_topTimes_txt2", 4);
            }

            if (eval($("#base_url_mode").prop("checked"))) {
                window.ec.saveConfig("runMode", 6);
            } else {
                window.ec.saveConfig("runMode", 1);
            }

            window.ec.call('collection_like_save', JSON.stringify($("#formData").serializeArray()));

            if (parseInt(num) === 0) {
                window.ec.toast("保存成功");
            }
        }
    </script>
</html>